
var li = document.querySelector(".box .navbar-nav .li-1");
var nav_body = document.querySelector(".nav-body1");

li.addEventListener("mouseover",function(){
	nav_body.style.display ="block"; 
})
li.addEventListener("mouseout",function(){
	nav_body.style.display ="none"; 
})
nav_body.addEventListener("mouseover",function(){
	nav_body.style.display ="block"; 
})
nav_body.addEventListener("mouseout",function(){
	nav_body.style.display ="none"; 
})



var li_1 = document.querySelector(".box .navbar-nav .li-2");
var nav_body2 = document.querySelector(".nav-body2");

li_1.addEventListener("mouseover",function(){
	nav_body2.style.display ="block"; 
})
li_1.addEventListener("mouseout",function(){
	nav_body2.style.display ="none"; 
})
nav_body2.addEventListener("mouseover",function(){
	nav_body2.style.display ="block"; 
})
nav_body2.addEventListener("mouseout",function(){
	nav_body2.style.display ="none"; 
})


new Vue({
	el:'#app',
	data:{
		message:"正在请求数据..."
	},
	mounted(){
		 axios
		 .get('new_file.json')
		 .then(response => this.message = response.data.urls)
	     .catch(function(error){
	     	console.log (error);
	     })
	}
})

new Vue({
	el:'#a',
	data:{
		message:"正在请求数据..."
	},
	mounted(){
		 axios
		 .get('new_file.json')
		 .then(response => this.message = response.data.lis)
	     .catch(function(error){
	     	console.log (error);
	     })
	}
})


new Vue({
	el:'#z',
	data:{
		message:"正在请求数据..."
	},
	mounted(){
		 axios
		 .get('new_file.json')
		 .then(response => this.message = response.data.list)
	     .catch(function(error){
	     	console.log (error);
	     })
	}
})


var totop = document.querySelector("#totop");
//滚动条事件，滚动触发一次，这个事件就会执行一次
window.onscroll = function() {
	console.log(document.documentElement.scrollTop);
	//判断它距离顶部的位置
	if(document.documentElement.scrollTop >1000|| document.body.scrollTop > 1000) {
		totop.style.display = "block";
	} else {
		totop.style.display = "none";
	}
}

totop.addEventListener("click", function() {
	//滚动到指定的位置
	window.scrollTo(0,0);

})
